package com.spring.cloud.practice.demo.eurekaclient1.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <b><code>BookController</code></b>
 * <p/>
 * Description
 * <p/>
 * <b>Creation Time:</b> 2019/8/1 15:14.
 *
 * @author huanghuayan
 * @since spring-cloud-demo
 */
@RestController
public class BookController {

    private Logger logger = LoggerFactory.getLogger(BookController.class);

    @Value("${server.port}")
    String port;

    @RequestMapping("getBook")
    public String getBook(@RequestParam String name) {
        logger.info("name:", name);
        return "The name of the book is " + name + ", i am from port:" + port;
    }
}
